//
//  DiaryDateExt.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/4.
//

import Foundation
//日记的日期格式处理
class DiaryDateExt{
    
    //日记日期
    static func getTimeStr(_ dateMode: IDateModeType, _ time: Int64) -> String {
        switch dateMode{
        case IDateModeType.MONTH:
            TimeUtils.getDate(time: time, format: "M月d HH:mm")
        case IDateModeType.YEAR:
            TimeUtils.getDate(time: time, format: "d号 HH:mm")
        default:
            TimeUtils.getDate(time: time, format: "HH:mm")
        }
    }
    
    //日记日期
    static func getTimeStr(_ dateMode: IDateModeType, _ time: TimeInterval) -> String {
        switch dateMode{
        case IDateModeType.MONTH:
            TimeUtils.getDate(time: time, format: "M月d HH:mm")
        case IDateModeType.YEAR:
            TimeUtils.getDate(time: time, format: "d号 HH:mm")
        default:
            TimeUtils.getDate(time: time, format: "HH:mm")
        }
    }
    
    //日记日期
    static func getTimeStr(_ dateMode: IDateModeType, _ date: Date) -> String {
        switch dateMode{
        case IDateModeType.MONTH:
            TimeUtils.getDate(date: date, format: "M月d HH:mm")
        case IDateModeType.YEAR:
            TimeUtils.getDate(date: date, format: "d号 HH:mm")
        default:
            TimeUtils.getDate(date: date, format: "HH:mm")
        }
    }
}
